# This script is the main driver for loading up all test data into a mysql db

# this is a generic function for doing the 3 steps of running the sparql query
# converting the data to sql, and adding it to the db
function full_run {
echo "Get data via sparql query"
time arq --results XML --query $1.spq --data dummy.ttl > $1.xml
echo "Convert xml to sql"
time xsltproc SPARQLXMLtoSQL${1}.xsl $1.xml > $1.sql
echo "insert into db"
time sudo mysql5 -f  < $1.sql
}

# here, we retrieve data for the 3 data sets
echo "Running data set manufacturers (around 50)"
time full_run "cars"
echo "Running data set companies (around 250)"
time full_run "companies"
echo "Running data set people (around 10000)"
time full_run "people_10000"

